﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Playlist_file_loader.Core
{
    class ObjectContainer
    {
        //-------------------------------------------------------------------//
        //-------------------------member variables--------------------------//
        //-------------------------------------------------------------------//

        private List<Object> m_ObjectContainer;

        //-------------------------------------------------------------------//
        //-------------------------function definitions----------------------//
        //-------------------------------------------------------------------//

        //-------------------------------------------------------------------//
        // Description: ...
        public ObjectContainer()
        {
            m_ObjectContainer = new List<Object>();
        }

        //-------------------------------------------------------------------//
        // Description: ...
        public void Add(Object obj)
        {
            m_ObjectContainer.Add(obj);
        }

        //-------------------------------------------------------------------//
        // Description: ...
        public Object Get( int index )
        {
            if (false == IsEmpty())
            {
                return m_ObjectContainer[ index ];
            }
            else return null;
        }
        
        //-------------------------------------------------------------------//
        // Description: ...
        public bool IsEmpty()
        {
            return m_ObjectContainer.Count == 0;
        }

        //-------------------------------------------------------------------//
        // Description: ...
        public int GetCount()
        {
            return m_ObjectContainer.Count;
        }

        //-------------------------------------------------------------------//
        // Description: clear the whole list
        public void Clear()
        {
            m_ObjectContainer.RemoveRange(0, m_ObjectContainer.Count);
        }

    }
}
